#pragma once

#include "BRTree.h"

namespace czb
{


	template<class K, class V>
	class map
	{
		struct MapKeyOfT
		{
			const V& operator() (const pair<K, V>& kv)
			{
				return kv.first;
			}
		};

		

	public:

		typedef typename BRTree<K, pair<const K, V>, MapKeyOfT>::iterator iterator;


		iterator begin()
		{
			return _t.begin();
		}

		iterator end()
		{
			return _t.end();
		}

		bool Insert(const pair<K, V>& kv)
		{
			return _t.Insert(kv);
		}

	private:
		BRTree<K, pair<const K, V>, MapKeyOfT> _t;
	};

}